/** @jsx createElement */

import { createElement, render, useState } from './react';

const App = function({ count }) {
    const [clickCount, setClickCount] = useState(1);
    const children = Array(count).fill(1).map((_, index) => <p>{index}</p>)

    return (<div>
        <h1><a href='http://www.baidu.com'>hello</a></h1>
        <p onClick={() => {
            setClickCount(clickCount+1)
        }}>my react, {clickCount}</p>
        {children}
    </div>);
}

render(<App count={1000}></App>, document.querySelector('#app'));

setTimeout(() => {
    render(<App count={2000}></App>, document.querySelector('#app'));
}, 5000);
